package com.ads.proplan.control;

import com.ads.proplan.activity.EstatisticaFragment;
import com.ads.proplan.activity.RankingFragment;
import com.ads.proplan.activity.TrofeuFragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

public class FragmentPagerAdapter extends FragmentStatePagerAdapter {
	public FragmentPagerAdapter(FragmentManager fm) {
		super(fm);
	}

	@Override
	public Fragment getItem(int i) {
		Fragment fragment = null;
        Bundle args;
        switch (i) {
		case 0:
	        fragment = new EstatisticaFragment();
	        args = new Bundle();
	        fragment.setArguments(args);
		break;
		case 1:
	        fragment = new TrofeuFragment();
	        args = new Bundle();
	        fragment.setArguments(args);
		break;
		case 2:
	        fragment = new RankingFragment();
	        args = new Bundle();
	        fragment.setArguments(args);
		break;
        default:
            break;
        }
		return fragment;
	}

	@Override
	public int getCount() {
		return 3;
	}

	@Override
	public CharSequence getPageTitle(int position) {
		return "OBJECT " + (position + 1);
	}
}
